package com.jemmyee.pizza.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "cai_detail")
public class CaiDetail implements java.io.Serializable {

	// Fields

	private Integer id;
	private Integer typeId;
	private Double huansuan;
	private Date jiDate;
	private String jiPingzheng;
	private String remark;
	private Double yuanjinjia;
	private Double jieCount;
	private Double jieMoney;
	private Double daiCount;
	private Double daiMoney;
	private Double yuCount;
	private Double yuMoney;
	private Integer userId;
	private Integer leixing;
	private Short status;
	private Date createTime;
	
	private CaiType caiType;
	private String daiMan;
	private String daiDept;
	
	private Integer type1;
	private Integer type2;
	private Integer type3;
	private Integer type4;
	
	
	
	@Transient
	public Integer getType1() {
		return type1;
	}

	public void setType1(Integer type1) {
		this.type1 = type1;
	}
	@Transient
	public Integer getType2() {
		return type2;
	}

	public void setType2(Integer type2) {
		this.type2 = type2;
	}
	@Transient
	public Integer getType3() {
		return type3;
	}

	public void setType3(Integer type3) {
		this.type3 = type3;
	}
	@Transient
	public Integer getType4() {
		return type4;
	}

	public void setType4(Integer type4) {
		this.type4 = type4;
	}

	private User user;
	
	
	
	
	@ManyToOne(cascade=CascadeType.MERGE,fetch=FetchType.LAZY)
	@JoinColumn(name="user_id",insertable=false,updatable=false)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "dai_ren")
	public String getDaiMan() {
		return daiMan;
	}

	public void setDaiMan(String daiMan) {
		this.daiMan = daiMan;
	}
	@Column(name = "dai_dept")
	public String getDaiDept() {
		return daiDept;
	}

	public void setDaiDept(String daiDept) {
		this.daiDept = daiDept;
	}

	// Constructors
	@ManyToOne(cascade=CascadeType.MERGE,fetch=FetchType.LAZY)
	@JoinColumn(name="type_id",insertable=false,updatable=false)
	public CaiType getCaiType() {
		return caiType;
	}

	public void setCaiType(CaiType caiType) {
		this.caiType = caiType;
	}

	/** default constructor */
	public CaiDetail() {
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "type_id")
	public Integer getTypeId() {
		return this.typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	@Column(name = "huansuan", precision = 22, scale = 0)
	public Double getHuansuan() {
		return this.huansuan;
	}

	public void setHuansuan(Double huansuan) {
		this.huansuan = huansuan;
	}
	@Column(name = "leixing")
	public Integer getLeixing() {
		return leixing;
	}

	public void setLeixing(Integer leixing) {
		this.leixing = leixing;
	}

	@Column(name = "ji_date", length = 0)
	public Date getJiDate() {
		return this.jiDate;
	}

	public void setJiDate(Date jiDate) {
		this.jiDate = jiDate;
	}

	@Column(name = "ji_pingzheng", length = 100)
	public String getJiPingzheng() {
		return this.jiPingzheng;
	}

	public void setJiPingzheng(String jiPingzheng) {
		this.jiPingzheng = jiPingzheng;
	}

	@Column(name = "remark", length = 1000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "yuanjinjia", precision = 22, scale = 0)
	public Double getYuanjinjia() {
		return this.yuanjinjia;
	}

	public void setYuanjinjia(Double yuanjinjia) {
		this.yuanjinjia = yuanjinjia;
	}

	@Column(name = "jie_count", precision = 22, scale = 0)
	public Double getJieCount() {
		return this.jieCount;
	}

	public void setJieCount(Double jieCount) {
		this.jieCount = jieCount;
	}

	@Column(name = "jie_money", precision = 22, scale = 0)
	public Double getJieMoney() {
		return this.jieMoney;
	}

	public void setJieMoney(Double jieMoney) {
		this.jieMoney = jieMoney;
	}

	@Column(name = "dai_count", precision = 22, scale = 0)
	public Double getDaiCount() {
		return this.daiCount;
	}

	public void setDaiCount(Double daiCount) {
		this.daiCount = daiCount;
	}

	@Column(name = "dai_money", precision = 22, scale = 0)
	public Double getDaiMoney() {
		return this.daiMoney;
	}

	public void setDaiMoney(Double daiMoney) {
		this.daiMoney = daiMoney;
	}

	@Column(name = "yu_count", precision = 22, scale = 0)
	public Double getYuCount() {
		return this.yuCount;
	}

	public void setYuCount(Double yuCount) {
		this.yuCount = yuCount;
	}

	@Column(name = "yu_money", precision = 22, scale = 0)
	public Double getYuMoney() {
		return this.yuMoney;
	}

	public void setYuMoney(Double yuMoney) {
		this.yuMoney = yuMoney;
	}

	@Column(name = "user_id")
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "status")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name = "create_time", length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}